home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Chooser.h
-
- Contains: Header file for Chooser PACK code to support USB and serial printers
-
- Version: xxx put version here xxx
-
-
-
- Copyright: © 1998 by Apple Computer, Inc., all rights reserved.
-
- */
- #ifndef __Chooser__
- #define __Chooser__
- #define kUSBModelPathString 1000
- #define kUSBPrinterPathString 2000
- #define kPrinterNameString 2100
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #include <CodeFragments.h>
-
- typedef struct
- {
- // address of name registry routines
- ProcPtr RegistryEntryIDInitAddr;
- ProcPtr RegistryCStrEntryLookupAddr;
- ProcPtr RegistryEntryIterateCreateAddr;
- ProcPtr RegistryEntryIterateDisposeAddr;
- ProcPtr RegistryEntryIterateSetAddr;
- ProcPtr RegistryEntryIterateAddr;
- ProcPtr RegistryEntryIDDisposeAddr;
- ProcPtr RegistryPropertyGetAddr;
-
- CFragConnectionID sCID; // our connection id to the name registry library
-
- Boolean hasNameRegistry; // does this cpu have a name registry
- Boolean checkedForNameRegistry; // did we check for the name registry already
-
- short numberOfPrinters; // total number of printers listed (unused for now)
- short numberOfUSBPrinters; // total number of USB printers
- short numberOfPorts; // total number of serial ports (0-if we don't support serial)
-
- Boolean supportsSerial; // do we support serial
- Boolean supportsUSB; // do we support USB
- // holds index into our STR# rsrc (name registry model path) for each entry in the printer list
- short* modelIndex;
- } USBGlobals, *USBGlobalsPtr, **USBGlobalsHandle;
-
- typedef struct
- {
- unsigned short branch; // Branch instruction.
- unsigned short devID; // Device ID.
- OSType resType; // Resource type (always 'PACK').
- short resID; // Resource ID (always -4096).
- short version; // Printer driver version.
- unsigned long flags; // Flag bits.
- long int storage; // our storage
- Str31 driverName; // Name of printer driver.
- char code[1]; // PACK code starts here.
- } ChooserPACKHeader, *ChooserPACKHeaderPtr, **ChooserPACKHeaderHdl;
-
- // description of the connection rsrc CTYP
- typedef struct
- {
- short selectedType; // connection type of the selected printer
- short supportsSerial; // do we support serial
- short supportsUSB; // do we support USB
- } ConnectionType, *ConnectionTypePtr, **ConnectionTypeHdl;
-
- extern OSErr InitGlobalStorage(void);
- extern void RemoveGlobalStorage(void);
- extern USBGlobalsHandle GetGlobalStorage(void);
- extern pascal OSErr Chooser( short message, short caller, StringPtr objName,
- StringPtr zoneName, long p1, long p2 );
-
- #endif
-